<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@taglib uri="/struts-dojo-tags" prefix="sx"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>SCA - Pesquisar Professor</title>
    </head>
    <body>
        <h1>Pesquisar Professor</h1>
        
        <s:form action="Professor">
            <s:textfield name="nomeProfessor" label="Nome Professor"></s:textfield>
            <s:submit action="pesquisarProfessor" value="Pesquisar"></s:submit>
            
            
            <table>
                <tr>
                    <th>Matrícula</th>
                    <th>Nome Professor</th>
                    <th colspan="2">Ações</th>
                </tr>
            <s:iterator value="professores">
                <tr>
                    <td>${matricula}</td>
                    <td>${nome}</td>
                    <td>
                            <s:url id="editarProfessor" action="editarProfessor">
                                <s:param name="matricula" value="%{matricula}"></s:param>
                            </s:url>
                            <s:a href="%{editarProfessor}">Editar</s:a>
                            </td>
                            <td>
                            <s:url id="excluirProfessor" action="excluirProfessor">
                                <s:param name="matricula" value="%{matricula}"></s:param>
                            </s:url>
                            <s:a href="%{excluirProfessor}">Excluir</s:a>
                    </td>
                </tr>
            </s:iterator>
            </table>
            
            <s:submit action="voltarProfessor" value="Voltar"></s:submit>
            <s:submit action="incluirProfessor" value="Incluir"></s:submit>
        </s:form>
    </body>
</html>
